package org.netty.push.api.dto;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(description = "消息推送响应")
public class PushReponse  implements Serializable{

	private static final long serialVersionUID = -8668894976404891766L;

	/**
	 * 消息Id
	 */
	@ApiModelProperty(value="消息Id")
	private String messageId;
	@ApiModelProperty(value="接口请求标识")
	private Boolean success;
	@ApiModelProperty(value="消息处理状态吗")
	private String code;
	@ApiModelProperty(value="错误描述信息")
	private String errormsg;
	
	private PushReponse(String messageId, Boolean success, String code, String errormsg) {
		super();
		this.messageId = messageId;
		this.success = success;
		this.code = code;
		this.errormsg = errormsg;
	}

	public static PushReponse buildError( String code, String errormsg) {
		return new PushReponse(null,false,code,errormsg);
	}

	public static PushReponse buildSuccess(String messageId) {
		return new PushReponse(messageId,true,null,null);
	}

	public String getCode() {
		return code;
	}


	public void setCode(String code) {
		this.code = code;
	}


	public String getErrormsg() {
		return errormsg;
	}


	public void setErrormsg(String errormsg) {
		this.errormsg = errormsg;
	}

	
	public Boolean getSuccess() {
		return success;
	}

	public void setSuccess(Boolean success) {
		this.success = success;
	}

	public String getMessageId() {
		return messageId;
	}

	public void setMessageId(String messageId) {
		this.messageId = messageId;
	}
	
}
